<?php include("facebook_include.php");?>
<?php
	$event_info = array();
    $event_info['name'] = 'My Party Invite';
    $event_info['category'] = '1'; // Use valid category number
    $event_info['subcategory'] = '1'; //Use valid subcategory number
    $event_info['host'] = 'Me';
    $event_info['location'] = 'My House';
    $event_info['city'] = 'Palo Alto, CA'; //Must be a valid city name
    $event_info['start_time'] = gmmktime(23,30,00,12,20,2009); //Epoch timestamp
    $event_info['end_time'] = gmmktime(23,45,00,12,20,2009);; //Epoch timestamp
	$event_info['description'] = htmlentities('http://google.com');
	$event_info['privacy_type'] = 'OPEN';
	$event_id = 0;
	try
        {
            $event_id =$facebook->api_client->events_create(json_encode($event_info));
            echo 'Event Created! Event Id is: '.$event_id;
	    
        }
        catch(Exception $e)
        {
            echo 'Error message: '.$e->getMessage().' Error code:'.$e->getCode();
        }
	$friends = getFriendsInApplication();
	$facebook->api_client->events_invite( $event_id, $friends, 'Test');

?>
